package com.taritari.journal.entity.po;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Random;

/**
 * @author taritari
 * @date 2024-05-11 16:01
 * @description 词云
 */

@Data
public class WordCloud {
    private String name;
    private int textSize;

    public WordCloud(String name, int textSize) {
        this.name = name;
        this.textSize = textSize;
    }
    public WordCloud() {
        Random random = new Random(); // 实例化Random对象
        int[] numbers = {25, 20, 12, 10}; // 定义可能的数字数组
        int number = numbers[random.nextInt(numbers.length)];//随机索引
        this.textSize = number;
    }

}
